import Vue from "vue";
import VueRouter from "vue-router";
// import Login from "../views/Login/index.vue"

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "login",
    hidden:true,
    meta:{
      name:"主页"
    }
  },
  {
    path: "/login",
    name: "login",
    hidden:true,
    meta:{
      name:"登录"
    },
    component: () => import("../views/Login/index.vue"),
  },
  {
    path: "/console",
    name: "Console",
    redirect:"index",
    meta:{
      name:"控制台"
    },
    icon:"el-icon-s-operation",
    component: () => import("../views/Layout/index.vue"),
    children:[
      {
        path: "/index",
        name: "index",
        component: () => import("../views/Console/index.vue"),
        meta:{
          name:"试试看"
        }
      }
    ]
  },
  /**
   * 信息管理
   */
  {
    path: "/info",
    name: "Info",
    meta:{
      name:"信息管理"
    },
    icon:"el-icon-s-claim",
    component: () => import("../views/Layout/index.vue"),
    children:[
      {
        path: "/infoIndex",
        name: "InfoIndex",
        component: () => import("../views/Info/index.vue"),
        meta:{
          name:"信息列表"
        }
      },
      {
        path: "/infoCategory",
        name: "InfoCategory",
        component: () => import("../views/Info/category.vue"),
        meta:{
          name:"信息分类"
        }
      },{
        path: "/infoDetailed/:id/:title",
        name: "InfoDetailed",
        hidden:true,
        component: () => import("../views/Info/detailed.vue"),
        meta:{
          name:"信息详情"
        }
      }
    ]
  },
  /**
   * 用户管理
   */
  {
    path: "/user",
    name: "User",
    meta:{
      name:"用户管理"
    },
    icon:"el-icon-s-check",
    component: () => import("../views/Layout/index.vue"),
    children:[
      {
        path: "/userIndex",
        name: "InfoIndex",
        component: () => import("../views/User/index.vue"),
        meta:{
          name:"用户列表"
        }
      }
    ]
  }
];

const router = new VueRouter({
  routes,
});

export default router;
